import 'dart:ui';

import 'package:flutter/material.dart';

import 'PhotoAdjust.dart';
import 'PhotoPost.dart';
import 'PhotoSetting.dart';

class Photo extends StatefulWidget {
  const Photo({super.key});

  @override
  State<Photo> createState() => _PhotoState();
}

class _PhotoState extends State<Photo> {
  @override
  Widget build(BuildContext context) {
    Size size = MediaQuery.of(context).size;

    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.transparent,
        title: Image.asset('assets/appbarjingzi.png'),
        centerTitle: true,
        leading: InkWell(
          onTap: () {
            Navigator.pop(context);
          },
          child: Image.asset('assets/appbarretrun.png'),
        ),
        actions: [
          InkWell(
            onTap: () {
              Navigator.push(context, MaterialPageRoute(builder: (builder) {
                return PhotoSetting();
              }));
            },
            child: Image.asset('assets/appbarsetting.png'),
          ),
          SizedBox(
            width: 30,
          )
        ],
      ),
      extendBodyBehindAppBar: true,
      body: Stack(
        children: [
          Image.asset(
            'assets/image3.png',
            fit: BoxFit.cover,
            width: size.width,
          ),
          Positioned(
            width: size.width,
            top: size.height / 1.7 - size.height / 40,
            right: 0,
            child: Divider(),
          ),
          Positioned(
            width: size.width,
            top: size.height / 2 - size.height / 5,
            right: 0,
            child: Divider(),
          ),
          Positioned(
            height: size.height - size.height / 7,
            right: size.width / 3,
            child: RotatedBox(
              quarterTurns: 1,
              child: Divider(),
            ),
          ),
          Positioned(
            height: size.height - size.height / 7,
            right: size.width / 1.5,
            child: RotatedBox(
              quarterTurns: 1,
              child: Divider(),
            ),
          ),
          Positioned(
            bottom: 0,
            child: ClipRect(
              child: BackdropFilter(
                filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
                child: Container(
                  padding: EdgeInsets.symmetric(
                      vertical: size.width / 20, horizontal: size.width / 40),
                  height: size.height / 7,
                  decoration: const BoxDecoration(
                    border: Border(top: BorderSide(color: Colors.grey)),
                    color: Colors.transparent,
                  ),
                  width: size.width,
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                    children: [
                      Image.asset('assets/Photobottom1.png'),
                      Image.asset('assets/Photobottom2.png'),
                      InkWell(
                        onTap: () {
                          Navigator.push(context,
                              MaterialPageRoute(builder: (builder) {
                            return PhotoPost();
                          }));
                        },
                        child: Container(
                          width: size.width / 6,
                          height: size.width / 6,
                          decoration: BoxDecoration(
                            gradient: LinearGradient(
                                begin: Alignment.topCenter,
                                end: Alignment.bottomCenter,
                                colors: [Color(0xffD5D6EA), Color(0xffFCFCFC)]),
                            border: Border.all(color: Colors.white, width: 5),
                            borderRadius: BorderRadius.circular(90),
                          ),
                        ),
                      ),
                      InkWell(
                          onTap: () {
                            Navigator.push(context,
                                MaterialPageRoute(builder: (builder) {
                              return PhotoAdjust();
                            }));
                          },
                          child: Image.asset('assets/Photobottom3.png')),
                      SizedBox(
                        height: 50,
                        width: 50,
                        child: ClipRRect(
                          borderRadius: BorderRadius.circular(10),
                          child: Image.asset(
                            'assets/Photobottom4.png',
                            fit: BoxFit.cover,
                            alignment: Alignment.topCenter,
                          ),
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
